package model

import (
	"gorm.io/gorm"
	"time"
)

type Subject struct {
	Id         uint64         `gorm:"column:id;type:int;primaryKey;not null;" json:"id"`
	Title      string         `gorm:"column:title;type:varchar(100);comment:话题标题;not null;" json:"title"` // 话题标题
	CreateUser uint64         `gorm:"column:create_user;type:int;not null;" json:"create_user"`
	CreatedAt  time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt  time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt  gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (s *Subject) TableName() string {
	return "subject"
}
